/**
 * Author(s): xuming.Wong <xuming.Wong@gmail.com>
 */

#ifndef __NetManager_H__
#define __NetManager_H__

#include "PQClientPrerequisites.h"

#include "PQNet.h"

namespace PQClient
{
	/*This class is used to manage the whole network layer.
	*/
	class NetManager
	{
	protected:
		NetManager();
	public:
		static NetManager& getSingleton()
		{
			static NetManager inst;
			return inst;

		}

		/*Connect to the server.
		*/
		void connect(const char* addr,int32 port);
		/*
		*/
		//void send(Packet* packet);

		/*Disconnect the server.
		*/
		void close();

	protected:
		HANDLE _threadHandle;//connect thread handle
		NetInputStream _inputStream;//net input stream(buffer)
		NetOutputStream _outputStream;//net output stream(buffer)

	};
}
#endif
